import CryptoJS from 'crypto-js';
const key = CryptoJS.enc.Utf8.parse('7JD8hYTVGySjnRlK');

export function encode(message:string) {
  const encrypted = CryptoJS.AES.encrypt(message, key, {
    mode: CryptoJS.mode.ECB,
    padding: CryptoJS.pad.Pkcs7,
  });
  return encrypted.toString();
}

export function decode(message:string) {
  const decrypted = CryptoJS.AES.decrypt(message, key, {
    mode: CryptoJS.mode.ECB,
    padding: CryptoJS.pad.Pkcs7,
  });
  return CryptoJS.enc.Utf8.stringify(decrypted).toString();
}
